using SM.core;
using SS;
using System;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Windows.Forms;
using TVSBarCode;
namespace TVSBH.func
{
	public class frmBarcode : Form
	{
		private Func objFunc = new Func();
		private DataTable objTable;
		private DataTable objTableBarcode = new DataTable();
		private Bill objBill = new Bill();
		private string sqlCon = "";
		private string currWhID = "";
		private string currPrice = "";
		public string userName = "";
		public string fullName = "";
		private EAN13CodeCtl eaN13CodeCtl1;
		private IContainer components = null;
		private DataGridView dgvProduct;
		private Button btnClose;
		private GroupBox groupBox1;
		private ComboBox cbbParentGID;
		private Label label1;
		private Button btnCreate;
		private GroupBox groupBox2;
		private Button btnPrint;
		private GroupBox groupBox3;
		private TextBox txtProductName;
		private Label label3;
		private TextBox txtBarcode;
		private Label label4;
		private NumericUpDown nudNumBarcode;
		private Button btnEdit;
		private TextBox txtSearch;
		private Label label2;
		private Label lblHeader;
		private PictureBox pictureBox1;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn1;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn2;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn3;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn4;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn5;
		private DataGridViewTextBoxColumn Column2;
		private DataGridViewTextBoxColumn Column1;
		private DataGridViewTextBoxColumn Column9;
		private DataGridViewTextBoxColumn Column3;
		private DataGridViewTextBoxColumn Column4;
		private DataGridViewTextBoxColumn ProductPrice2;
		private Label label5;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn6;
		public frmBarcode()
		{
			this.eaN13CodeCtl1 = new EAN13CodeCtl();
			this.eaN13CodeCtl1.BackColor = Color.White;
			this.eaN13CodeCtl1.Location = new System.Drawing.Point(15, 20);
			this.eaN13CodeCtl1.Name = "eaN13CodeCtl1";
			this.eaN13CodeCtl1.Size = new Size(140, 80);
			this.eaN13CodeCtl1.TabIndex = 50;
			this.InitializeComponent();
			this.groupBox2.Controls.Add(this.eaN13CodeCtl1);
		}
		private void frmInput_Load(object sender, EventArgs e)
		{
			this.sqlCon = this.objFunc.strConnectionString;
			this.objFunc.LoadComboBoxGProduct("SELECT [GpID], UPPER(GpName) AS GpName FROM TabGproducts ORDER BY GpName", this.cbbParentGID, "GpID", "GpName");
			this.dgvProduct.AutoGenerateColumns = false;
		}
		private void btnClose_Click(object sender, EventArgs e)
		{
			base.Close();
		}
		private void frmInput_KeyDown(object sender, KeyEventArgs e)
		{
			if (e.KeyCode == Keys.Escape)
			{
				base.Close();
			}
		}
		private void cbbParentGID_SelectedIndexChanged(object sender, EventArgs e)
		{
			if (this.cbbParentGID.SelectedValue.ToString() != "0")
			{
				this.getDetailBalancer(string.Concat(new string[]
				{
					"SELECT * FROM [TabDetailBill],[TabBill] WHERE [TabBill].[WID] = '",
					this.currWhID,
					"' AND [TabDetailBill].[billID] = [TabBill].[ID] AND [TypeInput] IN ('IN1','IN2','IN3') AND [TabDetailBill].[Pid] IN (SELECT [Pid] FROM [TabProducts] WHERE GpID = ",
					this.cbbParentGID.SelectedValue.ToString(),
					") ORDER BY [ProductName]"
				}));
			}
			else
			{
				this.getDetailBalancer("");
			}
		}
		public void getDetailBalancer(string sqlQuery)
		{
			try
			{
				DataTable dataTable = new DataTable();
				DataColumn column = new DataColumn("Pid", typeof(string));
				DataColumn column2 = new DataColumn("ProductName", typeof(string));
				DataColumn column3 = new DataColumn("Packet", typeof(string));
				DataColumn column4 = new DataColumn("Barcode", typeof(string));
				DataColumn column5 = new DataColumn("ProductName1", typeof(string));
				DataColumn column6 = new DataColumn("ProductPrice2", typeof(string));
				dataTable.Columns.Add(column);
				dataTable.Columns.Add(column2);
				dataTable.Columns.Add(column3);
				dataTable.Columns.Add(column4);
				dataTable.Columns.Add(column5);
				dataTable.Columns.Add(column6);
				SqlConnection sqlConnection = new SqlConnection(this.sqlCon);
				sqlConnection.Open();
				SqlCommand sqlCommand = sqlConnection.CreateCommand();
				if (sqlQuery == "")
				{
					sqlCommand.CommandText = "SELECT * FROM [TabDetailBill],[TabBill] WHERE [TabDetailBill].[billID] = [TabBill].[ID] AND [TypeInput] IN ('IN1','IN2','IN3') ORDER BY [ProductName]";
				}
				else
				{
					sqlCommand.CommandText = sqlQuery;
				}
				SqlDataReader sqlDataReader = sqlCommand.ExecuteReader();
				while (sqlDataReader.Read())
				{
					if (!this.checkProductNameInDataGridView(sqlDataReader["ProductName"].ToString(), dataTable))
					{
						dataTable.Rows.Add(new object[]
						{
							sqlDataReader["Pid"].ToString(),
							sqlDataReader["ProductName"].ToString().ToUpper(),
							sqlDataReader["Packet"].ToString(),
							sqlDataReader["Barcode"].ToString(),
							sqlDataReader["ProductName"].ToString(),
							sqlDataReader["ProductPrice2"].ToString()
						});
					}
					else
					{
						dataTable.Rows.Add(new object[]
						{
							sqlDataReader["Pid"].ToString(),
							"",
							sqlDataReader["Packet"].ToString(),
							sqlDataReader["Barcode"].ToString(),
							sqlDataReader["ProductName"].ToString(),
							sqlDataReader["ProductPrice2"].ToString()
						});
					}
				}
				sqlDataReader.Close();
				sqlConnection.Close();
				sqlConnection.Dispose();
				this.objTable = dataTable;
				this.dgvProduct.DataSource = this.objTable;
			}
			catch
			{
				this.objTable = null;
				this.dgvProduct.DataSource = this.objTable;
			}
		}
		private bool checkProductNameInDataGridView(string pName, DataTable objTable)
		{
			bool result = false;
			for (int i = 0; i < objTable.Rows.Count; i++)
			{
				if (objTable.Rows[i]["ProductName"].ToString().ToUpper() == pName.ToUpper())
				{
					result = true;
				}
			}
			return result;
		}
		private void btnSearch_Click(object sender, EventArgs e)
		{
			this.getDetailBalancer("");
		}
		private void resetDataGridView()
		{
			this.objTable = null;
			this.dgvProduct.DataSource = this.objTable;
		}
		private void btnCreate_Click(object sender, EventArgs e)
		{
			for (int i = 0; i < this.dgvProduct.Rows.Count; i++)
			{
				if (this.dgvProduct.Rows[i].Cells["Column3"].Value.ToString() == "0" || this.dgvProduct.Rows[i].Cells["Column3"].Value.ToString() == "")
				{
					this.dgvProduct.Rows[i].Cells["Column3"].Value = this.objFunc.GetNextBarcode();
					this.updateBarcode(this.dgvProduct.Rows[i].Cells["Column9"].Value.ToString(), this.dgvProduct.Rows[i].Cells["Column1"].Value.ToString(), this.dgvProduct.Rows[i].Cells["Column3"].Value.ToString());
					this.objFunc.SetBarcode(this.dgvProduct.Rows[i].Cells["Column3"].Value.ToString());
				}
				else
				{
					this.updateBarcode(this.dgvProduct.Rows[i].Cells["Column9"].Value.ToString(), this.dgvProduct.Rows[i].Cells["Column1"].Value.ToString(), this.dgvProduct.Rows[i].Cells["Column3"].Value.ToString());
				}
			}
			this.dgvProduct.ReadOnly = true;
			this.dgvProduct.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
			this.btnCreate.Text = "Tạo mã vạch";
		}
		public void updateBarcode(string Pid, string Packet, string Barcode)
		{
			SqlConnection sqlConnection = new SqlConnection(this.sqlCon);
			sqlConnection.Open();
			SqlCommand sqlCommand = sqlConnection.CreateCommand();
			sqlCommand.CommandText = string.Concat(new string[]
			{
				"UPDATE [TabDetailBill] SET [Barcode] = '",
				Barcode,
				"' WHERE [Pid] = ",
				Pid,
				" AND [Packet] = '",
				Packet,
				"'"
			});
			sqlCommand.ExecuteNonQuery();
			sqlConnection.Close();
			sqlConnection.Dispose();
		}
		private void dgvProduct_CellClick(object sender, DataGridViewCellEventArgs e)
		{
			try
			{
				this.txtProductName.Text = this.dgvProduct.CurrentRow.Cells["Column4"].Value.ToString();
				this.txtBarcode.Text = this.dgvProduct.CurrentRow.Cells[3].Value.ToString();
				this.currPrice = this.dgvProduct.CurrentRow.Cells["ProductPrice2"].Value.ToString();
				Image image = Code128Rendering.MakeBarcodeImage(this.txtBarcode.Text, 1, false);
				this.pictureBox1.Image = image;
			}
			catch
			{
			}
		}
		private void btnPrint_Click_2(object sender, EventArgs e)
		{
			if (this.txtProductName.Text != "" && this.txtBarcode.Text != "" && this.nudNumBarcode.Value != 0m && this.txtBarcode.Text != "0")
			{
				this.objTableBarcode = new DataTable();
				DataColumn column = new DataColumn("objClmName", typeof(string));
				DataColumn column2 = new DataColumn("objClmBarcode", typeof(string));
				DataColumn column3 = new DataColumn("objClmPrice", typeof(string));
				this.objTableBarcode.Columns.Add(column);
				this.objTableBarcode.Columns.Add(column2);
				this.objTableBarcode.Columns.Add(column3);
				int value;
				if (this.objFunc.GetPrintBarcodeType() == 1)
				{
					value = 5;
				}
				else
				{
					value = 3;
				}
				int num = 0;
				while (num < this.nudNumBarcode.Value / value)
				{
					if (this.txtProductName.Text.Trim().Length > 15)
					{
						this.objTableBarcode.Rows.Add(new object[]
						{
							this.txtProductName.Text.ToUpper().Substring(0, 15),
							this.txtBarcode.Text,
							"Giá : " + this.currPrice + " VNđ"
						});
					}
					else
					{
						this.objTableBarcode.Rows.Add(new object[]
						{
							this.txtProductName.Text.ToUpper(),
							this.txtBarcode.Text,
							"Giá : " + this.currPrice + " VNđ"
						});
					}
					num++;
				}
				frmBarcodeView frmBarcodeView = new frmBarcodeView();
				frmPrintBarcode.objTable = this.objTableBarcode;
				frmLaserPrintBarcode.objTable = this.objTableBarcode;
				frmBarcodeView.ShowDialog();
			}
			else
			{
				MessageBox.Show("Chưa đủ thông tin để in mã vạch, chọn sản phẩm cần in", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
			}
		}
		private void dgvProduct_CellEnter(object sender, DataGridViewCellEventArgs e)
		{
			try
			{
				this.txtProductName.Text = this.dgvProduct.CurrentRow.Cells["Column4"].Value.ToString();
				this.txtBarcode.Text = this.dgvProduct.CurrentRow.Cells[3].Value.ToString();
				this.currPrice = this.dgvProduct.CurrentRow.Cells["ProductPrice2"].Value.ToString();
				Image image = Code128Rendering.MakeBarcodeImage(this.txtBarcode.Text, 1, false);
				this.pictureBox1.Image = image;
			}
			catch
			{
			}
		}
		private void btnEdit_Click(object sender, EventArgs e)
		{
			this.dgvProduct.ReadOnly = false;
			this.dgvProduct.SelectionMode = DataGridViewSelectionMode.CellSelect;
			this.btnCreate.Text = "Lưu thông tin";
		}
		private void txtSearch_KeyDown(object sender, KeyEventArgs e)
		{
			if (this.txtSearch.Text != "")
			{
				if (e.KeyCode == Keys.Return)
				{
					this.getDetailBalancer(string.Concat(new string[]
					{
						"SELECT * FROM [TabDetailBill],[TabBill] WHERE [TabBill].[WID] = '",
						this.currWhID,
						"' AND [TabDetailBill].[billID] = [TabBill].[ID] AND [TypeInput] IN ('IN1','IN2','IN3') AND [TabDetailBill].[ProductName] LIKE N'%",
						this.txtSearch.Text.ToUpper(),
						"%' ORDER BY [ProductName]"
					}));
				}
			}
		}
		protected override void Dispose(bool disposing)
		{
			if (disposing && this.components != null)
			{
				this.components.Dispose();
			}
			base.Dispose(disposing);
		}
		private void InitializeComponent()
		{
			DataGridViewCellStyle dataGridViewCellStyle = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle2 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle3 = new DataGridViewCellStyle();
			ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(frmBarcode));
			this.dgvProduct = new DataGridView();
			this.btnClose = new Button();
			this.groupBox1 = new GroupBox();
			this.txtSearch = new TextBox();
			this.label2 = new Label();
			this.cbbParentGID = new ComboBox();
			this.label1 = new Label();
			this.btnCreate = new Button();
			this.groupBox2 = new GroupBox();
			this.pictureBox1 = new PictureBox();
			this.btnPrint = new Button();
			this.groupBox3 = new GroupBox();
			this.nudNumBarcode = new NumericUpDown();
			this.label4 = new Label();
			this.txtBarcode = new TextBox();
			this.txtProductName = new TextBox();
			this.label3 = new Label();
			this.btnEdit = new Button();
			this.lblHeader = new Label();
			this.label5 = new Label();
			this.dataGridViewTextBoxColumn1 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn2 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn3 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn4 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn5 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn6 = new DataGridViewTextBoxColumn();
			this.Column2 = new DataGridViewTextBoxColumn();
			this.Column1 = new DataGridViewTextBoxColumn();
			this.Column9 = new DataGridViewTextBoxColumn();
			this.Column3 = new DataGridViewTextBoxColumn();
			this.Column4 = new DataGridViewTextBoxColumn();
			this.ProductPrice2 = new DataGridViewTextBoxColumn();
			((ISupportInitialize)this.dgvProduct).BeginInit();
			this.groupBox1.SuspendLayout();
			this.groupBox2.SuspendLayout();
			((ISupportInitialize)this.pictureBox1).BeginInit();
			this.groupBox3.SuspendLayout();
			((ISupportInitialize)this.nudNumBarcode).BeginInit();
			base.SuspendLayout();
			this.dgvProduct.AllowUserToAddRows = false;
			this.dgvProduct.AllowUserToDeleteRows = false;
			this.dgvProduct.AllowUserToOrderColumns = true;
			this.dgvProduct.AllowUserToResizeColumns = false;
			this.dgvProduct.AllowUserToResizeRows = false;
			dataGridViewCellStyle.BackColor = Color.FromArgb(192, 255, 255);
			dataGridViewCellStyle.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.dgvProduct.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle;
			this.dgvProduct.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
			this.dgvProduct.BackgroundColor = Color.White;
			this.dgvProduct.BorderStyle = BorderStyle.Fixed3D;
			this.dgvProduct.ColumnHeadersHeight = 26;
			this.dgvProduct.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
			this.dgvProduct.Columns.AddRange(new DataGridViewColumn[]
			{
				this.Column2,
				this.Column1,
				this.Column9,
				this.Column3,
				this.Column4,
				this.ProductPrice2
			});
			this.dgvProduct.Cursor = Cursors.Hand;
			this.dgvProduct.EnableHeadersVisualStyles = false;
			this.dgvProduct.Location = new System.Drawing.Point(7, 90);
			this.dgvProduct.MultiSelect = false;
			this.dgvProduct.Name = "dgvProduct";
			this.dgvProduct.ReadOnly = true;
			this.dgvProduct.RowHeadersVisible = false;
			this.dgvProduct.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.DisableResizing;
			this.dgvProduct.RowTemplate.DefaultCellStyle.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.dgvProduct.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
			this.dgvProduct.Size = new Size(886, 390);
			this.dgvProduct.TabIndex = 1;
			this.dgvProduct.CellClick += new DataGridViewCellEventHandler(this.dgvProduct_CellClick);
			this.dgvProduct.CellEnter += new DataGridViewCellEventHandler(this.dgvProduct_CellEnter);
			this.btnClose.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.btnClose.FlatAppearance.BorderColor = Color.FromArgb(255, 128, 255);
			this.btnClose.FlatStyle = FlatStyle.Flat;
			this.btnClose.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnClose.Location = new System.Drawing.Point(355, 74);
			this.btnClose.Name = "btnClose";
			this.btnClose.Size = new Size(107, 26);
			this.btnClose.TabIndex = 38;
			this.btnClose.Text = "Thoát [ ESC ]";
			this.btnClose.UseVisualStyleBackColor = true;
			this.btnClose.Click += new EventHandler(this.btnClose_Click);
			this.groupBox1.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.groupBox1.Controls.Add(this.txtSearch);
			this.groupBox1.Controls.Add(this.label2);
			this.groupBox1.Controls.Add(this.cbbParentGID);
			this.groupBox1.Controls.Add(this.label1);
			this.groupBox1.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.groupBox1.Location = new System.Drawing.Point(7, 8);
			this.groupBox1.Name = "groupBox1";
			this.groupBox1.Size = new Size(886, 55);
			this.groupBox1.TabIndex = 39;
			this.groupBox1.TabStop = false;
			this.groupBox1.Text = "Điều kiện tìm kiếm";
			this.txtSearch.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.txtSearch.BackColor = Color.White;
			this.txtSearch.Font = new Font("Arial", 9f);
			this.txtSearch.Location = new System.Drawing.Point(465, 23);
			this.txtSearch.Name = "txtSearch";
			this.txtSearch.Size = new Size(411, 21);
			this.txtSearch.TabIndex = 53;
			this.txtSearch.KeyDown += new KeyEventHandler(this.txtSearch_KeyDown);
			this.label2.AutoSize = true;
			this.label2.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.label2.Location = new System.Drawing.Point(349, 26);
			this.label2.Name = "label2";
			this.label2.Size = new Size(112, 15);
			this.label2.TabIndex = 52;
			this.label2.Text = "Tên thuốc - vật tư :";
			this.cbbParentGID.BackColor = Color.White;
			this.cbbParentGID.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbbParentGID.FlatStyle = FlatStyle.Flat;
			this.cbbParentGID.Font = new Font("Arial", 8.5f, FontStyle.Bold);
			this.cbbParentGID.FormattingEnabled = true;
			this.cbbParentGID.Location = new System.Drawing.Point(83, 23);
			this.cbbParentGID.Name = "cbbParentGID";
			this.cbbParentGID.Size = new Size(264, 22);
			this.cbbParentGID.TabIndex = 40;
			this.cbbParentGID.SelectedIndexChanged += new EventHandler(this.cbbParentGID_SelectedIndexChanged);
			this.cbbParentGID.SelectedValueChanged += new EventHandler(this.cbbParentGID_SelectedIndexChanged);
			this.label1.AutoSize = true;
			this.label1.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.label1.Location = new System.Drawing.Point(9, 26);
			this.label1.Name = "label1";
			this.label1.Size = new Size(72, 15);
			this.label1.TabIndex = 41;
			this.label1.Text = "Loại thuốc :";
			this.btnCreate.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.btnCreate.FlatAppearance.BorderColor = Color.FromArgb(255, 128, 255);
			this.btnCreate.FlatStyle = FlatStyle.Flat;
			this.btnCreate.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnCreate.Location = new System.Drawing.Point(110, 74);
			this.btnCreate.Name = "btnCreate";
			this.btnCreate.Size = new Size(99, 26);
			this.btnCreate.TabIndex = 42;
			this.btnCreate.Text = "Tạo mã vạch";
			this.btnCreate.UseVisualStyleBackColor = true;
			this.btnCreate.Click += new EventHandler(this.btnCreate_Click);
			this.groupBox2.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.groupBox2.Controls.Add(this.pictureBox1);
			this.groupBox2.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.groupBox2.Location = new System.Drawing.Point(7, 484);
			this.groupBox2.Name = "groupBox2";
			this.groupBox2.Size = new Size(170, 110);
			this.groupBox2.TabIndex = 43;
			this.groupBox2.TabStop = false;
			this.groupBox2.Text = "Mã vạch";
			this.pictureBox1.Location = new System.Drawing.Point(4, 17);
			this.pictureBox1.Name = "pictureBox1";
			this.pictureBox1.Size = new Size(162, 87);
			this.pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
			this.pictureBox1.TabIndex = 0;
			this.pictureBox1.TabStop = false;
			this.btnPrint.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.btnPrint.FlatAppearance.BorderColor = Color.FromArgb(255, 128, 255);
			this.btnPrint.FlatStyle = FlatStyle.Flat;
			this.btnPrint.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnPrint.Location = new System.Drawing.Point(213, 74);
			this.btnPrint.Name = "btnPrint";
			this.btnPrint.Size = new Size(138, 26);
			this.btnPrint.TabIndex = 44;
			this.btnPrint.Text = "In mã vạch";
			this.btnPrint.UseVisualStyleBackColor = true;
			this.btnPrint.Click += new EventHandler(this.btnPrint_Click_2);
			this.groupBox3.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
			this.groupBox3.Controls.Add(this.label5);
			this.groupBox3.Controls.Add(this.btnPrint);
			this.groupBox3.Controls.Add(this.btnEdit);
			this.groupBox3.Controls.Add(this.nudNumBarcode);
			this.groupBox3.Controls.Add(this.label4);
			this.groupBox3.Controls.Add(this.btnCreate);
			this.groupBox3.Controls.Add(this.txtBarcode);
			this.groupBox3.Controls.Add(this.btnClose);
			this.groupBox3.Controls.Add(this.txtProductName);
			this.groupBox3.Controls.Add(this.label3);
			this.groupBox3.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.groupBox3.Location = new System.Drawing.Point(183, 484);
			this.groupBox3.Name = "groupBox3";
			this.groupBox3.Size = new Size(710, 110);
			this.groupBox3.TabIndex = 45;
			this.groupBox3.TabStop = false;
			this.groupBox3.Text = "Sản phẩm in mã vạch";
			this.nudNumBarcode.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.nudNumBarcode.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 163);
			//NumericUpDown arg_CFE_0 = this.nudNumBarcode;
			int[] array = new int[4];
			array[0] = 3;
            nudNumBarcode.Increment = new decimal(array);
			this.nudNumBarcode.Location = new System.Drawing.Point(355, 47);
			//NumericUpDown arg_D3A_0 = this.nudNumBarcode;
            //array = new int[4];
            //array[0] = 300;
            nudNumBarcode.Maximum = new decimal(array);
			this.nudNumBarcode.Name = "nudNumBarcode";
			this.nudNumBarcode.Size = new Size(107, 21);
			this.nudNumBarcode.TabIndex = 4;
			this.nudNumBarcode.TextAlign = HorizontalAlignment.Center;
            //NumericUpDown arg_D9B_0 = this.nudNumBarcode;
            //array = new int[4];
            //array[0] = 30;
            nudNumBarcode.Value = new decimal(array);
			this.label4.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.label4.BackColor = SystemColors.ControlLight;
			this.label4.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.label4.Location = new System.Drawing.Point(355, 27);
			this.label4.Name = "label4";
			this.label4.Size = new Size(107, 20);
			this.label4.TabIndex = 3;
			this.label4.Text = "Số mã vạch cần in";
			this.label4.TextAlign = ContentAlignment.MiddleCenter;
			this.txtBarcode.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.txtBarcode.BackColor = Color.White;
			this.txtBarcode.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 0);
			this.txtBarcode.Location = new System.Drawing.Point(213, 47);
			this.txtBarcode.Name = "txtBarcode";
			this.txtBarcode.ReadOnly = true;
			this.txtBarcode.Size = new Size(138, 21);
			this.txtBarcode.TabIndex = 2;
			this.txtBarcode.TextAlign = HorizontalAlignment.Center;
			this.txtProductName.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.txtProductName.BackColor = Color.White;
			this.txtProductName.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 0);
			this.txtProductName.Location = new System.Drawing.Point(7, 47);
			this.txtProductName.Name = "txtProductName";
			this.txtProductName.ReadOnly = true;
			this.txtProductName.Size = new Size(202, 21);
			this.txtProductName.TabIndex = 1;
			this.label3.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.label3.BackColor = SystemColors.ControlLight;
			this.label3.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.label3.Location = new System.Drawing.Point(7, 27);
			this.label3.Name = "label3";
			this.label3.Size = new Size(202, 20);
			this.label3.TabIndex = 0;
			this.label3.Text = "Tên thuốc - vật tư";
			this.label3.TextAlign = ContentAlignment.MiddleCenter;
			this.btnEdit.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.btnEdit.FlatAppearance.BorderColor = Color.FromArgb(255, 128, 255);
			this.btnEdit.FlatStyle = FlatStyle.Flat;
			this.btnEdit.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnEdit.Location = new System.Drawing.Point(7, 74);
			this.btnEdit.Name = "btnEdit";
			this.btnEdit.Size = new Size(99, 26);
			this.btnEdit.TabIndex = 46;
			this.btnEdit.Text = "Sửa mã vạch";
			this.btnEdit.UseVisualStyleBackColor = true;
			this.btnEdit.Click += new EventHandler(this.btnEdit_Click);
			this.lblHeader.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.lblHeader.BackColor = SystemColors.ControlLight;
			this.lblHeader.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 0);
			this.lblHeader.Location = new System.Drawing.Point(7, 66);
			this.lblHeader.Name = "lblHeader";
			this.lblHeader.Size = new Size(886, 24);
			this.lblHeader.TabIndex = 47;
			this.lblHeader.Text = "QUẢN LÝ MÃ VẠCH THEO LÔ CỦA SẢN PHẨM";
			this.lblHeader.TextAlign = ContentAlignment.MiddleCenter;
			this.label5.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.label5.BackColor = SystemColors.ControlLight;
			this.label5.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.label5.Location = new System.Drawing.Point(213, 27);
			this.label5.Name = "label5";
			this.label5.Size = new Size(138, 20);
			this.label5.TabIndex = 47;
			this.label5.Text = "Mã vạch";
			this.label5.TextAlign = ContentAlignment.MiddleCenter;
			this.dataGridViewTextBoxColumn1.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
			this.dataGridViewTextBoxColumn1.DataPropertyName = "productName";
			this.dataGridViewTextBoxColumn1.HeaderText = "Sản phẩm";
			this.dataGridViewTextBoxColumn1.MinimumWidth = 100;
			this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
			this.dataGridViewTextBoxColumn1.ReadOnly = true;
			this.dataGridViewTextBoxColumn1.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.dataGridViewTextBoxColumn2.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn2.DataPropertyName = "Packet";
			this.dataGridViewTextBoxColumn2.HeaderText = "Số lô";
			this.dataGridViewTextBoxColumn2.MinimumWidth = 150;
			this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
			this.dataGridViewTextBoxColumn2.ReadOnly = true;
			this.dataGridViewTextBoxColumn2.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.dataGridViewTextBoxColumn2.Width = 150;
			this.dataGridViewTextBoxColumn3.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn3.DataPropertyName = "Pid";
			this.dataGridViewTextBoxColumn3.HeaderText = "Mã sản phẩm";
			this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3";
			this.dataGridViewTextBoxColumn3.ReadOnly = true;
			this.dataGridViewTextBoxColumn3.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.dataGridViewTextBoxColumn3.Visible = false;
			this.dataGridViewTextBoxColumn4.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn4.DataPropertyName = "Barcode";
			dataGridViewCellStyle2.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle2.Font = new Font("Arial", 9.75f, FontStyle.Bold, GraphicsUnit.Point, 0);
			this.dataGridViewTextBoxColumn4.DefaultCellStyle = dataGridViewCellStyle2;
			this.dataGridViewTextBoxColumn4.HeaderText = "Mã vạch";
			this.dataGridViewTextBoxColumn4.MinimumWidth = 110;
			this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4";
			this.dataGridViewTextBoxColumn4.ReadOnly = true;
			this.dataGridViewTextBoxColumn4.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.dataGridViewTextBoxColumn4.Width = 110;
			this.dataGridViewTextBoxColumn5.DataPropertyName = "ProductName1";
			this.dataGridViewTextBoxColumn5.HeaderText = "TSP";
			this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5";
			this.dataGridViewTextBoxColumn5.ReadOnly = true;
			this.dataGridViewTextBoxColumn5.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.dataGridViewTextBoxColumn5.Visible = false;
			this.dataGridViewTextBoxColumn6.DataPropertyName = "ProductPrice2";
			this.dataGridViewTextBoxColumn6.HeaderText = "Price";
			this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6";
			this.dataGridViewTextBoxColumn6.Visible = false;
			this.Column2.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
			this.Column2.DataPropertyName = "productName";
			this.Column2.HeaderText = "Sản phẩm";
			this.Column2.MinimumWidth = 100;
			this.Column2.Name = "Column2";
			this.Column2.ReadOnly = true;
			this.Column2.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.Column1.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column1.DataPropertyName = "Packet";
			this.Column1.HeaderText = "Số lô";
			this.Column1.MinimumWidth = 150;
			this.Column1.Name = "Column1";
			this.Column1.ReadOnly = true;
			this.Column1.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.Column1.Width = 150;
			this.Column9.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column9.DataPropertyName = "Pid";
			this.Column9.HeaderText = "Mã sản phẩm";
			this.Column9.Name = "Column9";
			this.Column9.ReadOnly = true;
			this.Column9.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.Column9.Visible = false;
			this.Column3.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column3.DataPropertyName = "Barcode";
			dataGridViewCellStyle3.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle3.Font = new Font("Arial", 9.75f, FontStyle.Bold, GraphicsUnit.Point, 0);
			this.Column3.DefaultCellStyle = dataGridViewCellStyle3;
			this.Column3.HeaderText = "Mã vạch";
			this.Column3.MinimumWidth = 110;
			this.Column3.Name = "Column3";
			this.Column3.ReadOnly = true;
			this.Column3.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.Column3.Width = 110;
			this.Column4.DataPropertyName = "ProductName1";
			this.Column4.HeaderText = "TSP";
			this.Column4.Name = "Column4";
			this.Column4.ReadOnly = true;
			this.Column4.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.Column4.Visible = false;
			this.ProductPrice2.DataPropertyName = "ProductPrice2";
			this.ProductPrice2.HeaderText = "Price";
			this.ProductPrice2.Name = "ProductPrice2";
			this.ProductPrice2.ReadOnly = true;
			this.ProductPrice2.Visible = false;
			base.AutoScaleDimensions = new SizeF(7f, 15f);
			//base.AutoScaleMode = AutoScaleMode.Font;
			this.BackColor = Color.White;
			base.ClientSize = new Size(900, 600);
			base.Controls.Add(this.lblHeader);
			base.Controls.Add(this.groupBox2);
			base.Controls.Add(this.groupBox1);
			base.Controls.Add(this.dgvProduct);
			base.Controls.Add(this.groupBox3);
			this.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			//base.Icon = (System.Drawing.Icon)componentResourceManager.GetObject("$this.Icon");
			//base.Icon = (Icon)componentResourceManager.GetObject("$this.Icon");
			base.KeyPreview = true;
			base.Name = "frmBarcode";
			base.ShowInTaskbar = false;
			base.StartPosition = FormStartPosition.CenterScreen;
			this.Text = "QUẢN LÝ MÃ VẠCH";
			base.WindowState = FormWindowState.Maximized;
			base.Load += new EventHandler(this.frmInput_Load);
			base.KeyDown += new KeyEventHandler(this.frmInput_KeyDown);
			((ISupportInitialize)this.dgvProduct).EndInit();
			this.groupBox1.ResumeLayout(false);
			this.groupBox1.PerformLayout();
			this.groupBox2.ResumeLayout(false);
			((ISupportInitialize)this.pictureBox1).EndInit();
			this.groupBox3.ResumeLayout(false);
			this.groupBox3.PerformLayout();
			((ISupportInitialize)this.nudNumBarcode).EndInit();
			base.ResumeLayout(false);
		}
	}
}
